<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.entity.Push_work" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Push_work> list2 = (List<Push_work>) request.getAttribute("list2");
    String url = request.getContextPath();
%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>
    <style>
        body {
            font-family: '宋体';
            font-size: 20px;
            background-image: url("<%=url%>/images/2.jpg");
            background-repeat: no-repeat;
            background-size: cover;
        }
        table{
            background-color: rgb(33, 110, 161);
            border: 1px;
            margin: 0;
        }
        th{
            border: 2px solid rebeccapurple;
            background-color: rgb(33, 110, 161);
        }
        tr td{
            text-align: center;
            border: 1px solid;
        }
 #d0 input{
     font-size: 20px;
     font-family: "宋体";
 }
    </style>
</head>
<body>
<%--    <div id="d0" >--%>
<%--        <br>--%>
<%--        <form id="insertWorkServlet" method="post" action="insertWork">&ndash;%&gt;--%>
<%--       作业名称：<input type="text" name="workName"><br><br> <br>&ndash;%&gt;--%>
<%--        日&emsp;&emsp;期：<input type="date" name="pushDate"><br><br><br>&ndash;%&gt;--%>
<%--      内&emsp;&emsp;容<br><br><textarea  cols="25" rows="5" class="text" name="work">&ndash;%&gt;--%>
<%--       </textarea><br><br> &ndash;%&gt;--%>
<%--        <input type="submit" value="发布" style="width:100px; height:40px" >--%>
<%--        <input type="submit" value="返回" style="width:100px; height:40px"  onclick="javascript:window.history.back(-1);">--%>
<%--            </form>--%>
<%--    </div>--%>
<table align="center">
    <tr>
        <th width="300px">id</th>
        <th width="300px">题目</th>
        <th width="450px">发布日期</th>
        <th width="1050px">题目内容</th>
    </tr>
    <c:forEach var="pushedworks" items="${list2}" varStatus="status">
        <tr>
            <td>
                <span>${pushedworks.id}</span>
            </td>
            <td>
                <span>${pushedworks.workName}</span>
            </td>
            <td>
                <span>${pushedworks.pushDate}</span>
            </td>
            <td>
                <span>${pushedworks.work}</span>
            </td>
        </tr>
    </c:forEach>
</table>
<%--<a href="<%=url%>/addWorks" id="">添加作业</a>--%>
<form action="addWorks">
    <input type="submit" name="addWorks" value="添加作业">
<%--    <input type="submit" value="返回" style="width:100px; height:40px"  onclick="javascript:window.history.back(-1);">--%>
</form>
</body>
</html>